package com.zx.tfw.enums;

import java.util.HashMap;
import java.util.Map;

public enum LanguageEnum {
	
	Java			(1, "Java"),
	Python			(2, "Python"),
	Scala			(3, "Scala"),
	Golang			(4, "golang"),
	CorCpp			(5, "C/C++"),
	JavaScript		(6, "JavaScript"),
	HTML			(7, "HTML"),
	Docker			(8, "Docker"),
	CSS				(9, "CSS"),
	Other			(10, "其他");
	
	private int code;
	
	private String name;

	private LanguageEnum(int code, String name) {
		this.code = code;
		this.name = name;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	private static Map<Integer, LanguageEnum> map;
	static {
		map = new HashMap<>();
		LanguageEnum[] values = LanguageEnum.values();
		for (LanguageEnum typeEnum : values) {
			map.put(typeEnum.getCode(), typeEnum);
		}
	}
	
	public static Map<Integer, LanguageEnum> asMap(){
		return map;
	}
	
}
